#ifndef __INTF_USB_H__
#define __INTF_USB_H__


#define ENDPOINT_NUM_MAX    12  //usb端点号最大值

typedef struct _INTF_USB_CMD_STRUCT_
{
    unsigned char *buff;
    unsigned int write_len;
    unsigned int read_len;
    unsigned int timeout;
}INTF_USB_CMD_STRUCT;


typedef struct _INTF_USB_ID_STRUCT_
{
    uint16 idVendor;
    uint16 idProduct;
    char *description;
}INTF_USB_ID_STRUCT;

#if 0
struct usb_id {
    uint16 idVendor;
    uint16 idProduct;
    char * description;
};
#endif

typedef struct _INTF_USB_HANDLE_STRUCT_
{
    void *handle;//libusb_device_handle
    uint8 endpoint_in;
    uint8 endpoint_out;
}INTF_USB_HANDLE_STRUCT;


extern int32 intf_usb_init(void);
extern int32 intf_usb_free(void);
extern int32 intf_usb_open(INTF_USB_ID_STRUCT *usb_id, INTF_USB_HANDLE_STRUCT *usb_handle);
extern int32 intf_usb_close(INTF_USB_HANDLE_STRUCT *usb_handle);
extern int32 intf_usb_bulk_transfer(INTF_USB_HANDLE_STRUCT *usb_handle, INTF_USB_CMD_STRUCT *usb_cmd);
extern int32 intf_usb_check_device_exist(INTF_USB_ID_STRUCT *usb_id);
extern int32 intf_usb_get_device_path(INTF_USB_ID_STRUCT *usb_id, char *dev_port_path, int len);

#endif

